package cn.iocoder.yudao.module.pay.statistics.api;

import cn.iocoder.yudao.module.api.pay.statistics.PayStatisticsApi;
import cn.iocoder.yudao.module.api.pay.statistics.dto.PayWalletRechargeSummaryRespDTO;
import cn.iocoder.yudao.module.api.pay.statistics.dto.PayWalletSummaryRespDTO;
import cn.iocoder.yudao.module.pay.statistics.bo.WalletRechargeSummaryRespBO;
import cn.iocoder.yudao.module.pay.statistics.bo.WalletSummaryRespBO;
import cn.iocoder.yudao.module.pay.statistics.convert.PayStatisticsConvert;
import cn.iocoder.yudao.module.pay.statistics.service.PayWalletStatisticsService;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;

/**
 * 财务统计 API 实现类
 *
 * @author 芋道源码
 */
@Service
public class PayStatisticsApiImpl implements PayStatisticsApi {
    @Resource
    private PayWalletStatisticsService payWalletStatisticsService;

    @Override
    public PayWalletSummaryRespDTO getWalletSummary(LocalDateTime beginTime, LocalDateTime endTime) {
        WalletSummaryRespBO summary = payWalletStatisticsService.getWalletSummary(beginTime, endTime);
        return PayStatisticsConvert.INSTANCE.convert(summary);
    }

    @Override
    public PayWalletRechargeSummaryRespDTO getWalletRechargeSummary(LocalDateTime beginTime, LocalDateTime endTime) {
        WalletRechargeSummaryRespBO summary = payWalletStatisticsService.getWalletRechargeSummary(beginTime, endTime);
        return PayStatisticsConvert.INSTANCE.convert(summary);
    }

}
